#ifndef __BUOLA_GUI_DND_CDRAG_H__
#define __BUOLA_GUI_DND_CDRAG_H__

#include <buola/gui.h>
#include <buola/gui/cpointer.h>
#include <buola/image/cpicture.h>
#include <buola/gui/dnd/cdragimpl.h>

namespace buola { namespace gui {

class CDrag
{
public:
    CDrag(CDragSource *pSource,const img::CPicture &pImage=img::CPicture());

    void SetImage(const img::CPicture &pImage);
    void SetHotSpot(const CPoint_d &pPoint);

//Source actions
    void Drag();

    CDragImpl *Impl()   {   return mImpl;   }


///for use from the implementation
    void Move(const CPoint_d&);
    void Finish();
    void Discard();
    void Drop();

    void SetStatus(EDNDStatus);


protected:
    CDragImpl *mImpl;

    CDragSource *mSource;   //Local source
    PWindow mSourceWin;    //Local win

    CPoint_d mLastPoint;
    CPointer::EStock mLastPointer;

    PDndWindow mDecoration;
    img::CPicture mImage;
    CPoint_d mHotSpot;

    friend class CDropTarget;
    friend class CDragSource;
    friend class CToolkit;
};

/*namespace gui*/ } /*namespace buola*/ }

#endif
